<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateCategoriesTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('categories', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('topid')->unsigned()->nullable()->comment('顶级栏目');
			$table->integer('pid')->unsigned()->nullable();
			$table->boolean('mod')->nullable()->comment('1文章2图片3文件4视频');
			$table->integer('channelid')->unsigned()->nullable()->comment('所属频道ID');
			$table->smallInteger('ispart')->nullable()->comment('栏目属性（0：最终列表栏目；1：频道封面；2：外部连接）');
			$table->smallInteger('is_default')->nullable()->comment('栏目列表选项（1：链接到默认页；0：链接到列表第一页；-1：使用动态页）');
			$table->smallInteger('corank')->nullable()->comment('浏览权限');
			$table->string('defaultname')->nullable()->comment('默认页的名称');
			$table->string('cat_name')->nullable();
			$table->string('desc')->nullable()->comment('描述');
			$table->string('keywords')->nullable()->comment('关键字');
			$table->string('temparticle')->nullable()->comment('内容模板

内容模板

内容模板

内容模板');
			$table->string('templist')->nullable()->comment('列表模板');
			$table->string('tempindex')->nullable()->comment('封面模板');
			$table->string('tpl')->nullable();
			$table->integer('sort')->nullable();
			$table->boolean('status')->nullable()->comment('1展示2隐藏');
			$table->boolean('cross')->nullable()->comment('栏目交（0：不交叉；1：自动获取同名栏目内容；2：手工指定交叉栏目ID）');
			$table->integer('crossid')->unsigned()->nullable()->comment('交叉栏目ID');
			$table->string('content')->nullable()->comment('栏目内容');
			$table->string('slug')->nullable()->unique('slug');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('categories');
	}

}
